﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections;
using NHibernate.Mapping;
using DomainModel.Concrete;

namespace DomainModel.Entities
{
    public class _ContentBase : IDataErrorInfo
    {
                
        public virtual string Title { get; set; }

        public virtual string Description { get; set; }

        public virtual string Content { get; set; }

        public virtual string Author {get;set;}

        public virtual bool IsPublished { get; set; }

        public virtual DateTime DateUpdated { get; set; }

        //public virtual DateTime DateCreated { get; set; }


        public virtual string this[string propName]
        {
            get
            {
                if ((propName == "Title") && string.IsNullOrEmpty(Title))
                    return "Please enter a title";
                if ((propName == "Description") && string.IsNullOrEmpty(Description))
                    return "Please enter a description";
                if ((propName == "Content") && string.IsNullOrEmpty(Content))
                    return "Please enter a Content";
                return null;
            }
        }

      

        public virtual string Error { get { return null; } } // Not required
    }
}
